<?php
include('header.php');
use Goutte\Client;
use GuzzleHttp\Client as GuzzleClient;
//$db->where('id',5,'<=');
//$db->where('yj',null,'is');
$list = $db->get("dm", null, array('dm'));
$client = new Client();
echo '公司简介-start'.date('Y-m-d H:i:s')."\n";
foreach ($list as $v){	
	 $name = $v['dm'];
	$f = substr($name,0,1);
	if($f==6){
		$code = 'sh'.$name;
	}else{
		$code = 'sz'.$name;
	}
	$_SESSION['des'] = file_get_contents('http://emweb.securities.eastmoney.com/PC_HSF10/CompanySurvey/CompanySurveyAjax?code='.$code);
	echo $name."\n";
	$db->where ('dm', $name);
	$db->update ('dm', array('content'=>$_SESSION['des'] ));
	}
	echo '公司简介-end-success'.date('Y-m-d H:i:s')."\n";

